package com.itheima.inner.test9;

public class Test {

    public static void main(String[] args) {
        // 写实现类  重写方法  创建对象
        goSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("铁汁,我们去看腿吧");
            }
        });
    }



    //准备一个需要Swimming接口的方法
    public static void goSwimming(Swimming s){
        s.swim();
    }

}

interface Swimming{
   abstract void swim();

}
